/-app
/-docs
/-files
/-fs
/-fs/attached
/-imports
/-persistence ...
Drive.ts
/-storage
/-typings
errors.js
functions.ts
index.html
try.js
x
1
module teapo.persistence {
2
  
3
  export interface Drive {
4
    
5
    files(): string[];
6
​
7
    read(file: string): string;
8
​
9
    write(file: string, content: string);
10
    
11
  }
12
  
13
  export module Drive {
14
    
15
    export interface DriveMirror {
16
      
17
      write(file: string, content: string);
18
      
19
    }
20
    
21
    export interface Optional {
22
      
23
      detect(uniqueId: string, callback: (error: Error, detached: Detached) => void ): void;
24
      
25
    }
26
    
27
    export interface Detached {
28
      
29
      timestamp: number;
30
      
31
      apply(mainDrive: Drive, callback: (loaded: DriveMirror) => void): void;
32
      
33
      purge(callback: (loaded: DriveMirror) => void): void;
34
      
35
    }
36
    
37
  }
38
  
39
}
13:0